You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2021/07/15 16:27:09 UTC

[GitHub] [trafficserver] SolidWallOfCode commented on a change in pull request #8062: Log meta file: ensure the entire contents are written

SolidWallOfCode commented on a change in pull request #8062:
URL: https://github.com/apache/trafficserver/pull/8062#discussion_r670623921



##########
File path: src/tscore/ink_sock.cc
##########
@@ -111,6 +112,26 @@ safe_clr_fl(int fd, int arg)
   return flags;
 }
 
+int
+safe_write(int fd, const char *buffer, int len)
+{
+  int num_written = 0;
+  while (num_written < len) {

Review comment:
       I think this should be re-ordered such that the `write` is attempted first, and only if that doesn't fully succeed should `write_ready` be invoked. That reduces the impact of calling this for the (by far) common case.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org