cosmetics: use write instead of writev if there is only one buffer to
write (looks nicer in strace)
This commit is contained in:
parent
2041392b9f
commit
523f6f4765
@ -10,6 +10,7 @@
|
|||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <netinet/tcp.h>
|
#include <netinet/tcp.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include "havealloca.h"
|
#include "havealloca.h"
|
||||||
#include "iob_internal.h"
|
#include "iob_internal.h"
|
||||||
|
|
||||||
@ -65,6 +66,9 @@ int64 iob_send(int64 s,io_batch* b) {
|
|||||||
} else
|
} else
|
||||||
sent=-3;
|
sent=-3;
|
||||||
} else {
|
} else {
|
||||||
|
if (headers==1) /* cosmetics for strace */
|
||||||
|
sent=write(s,v[0].iov_base,v[0].iov_len);
|
||||||
|
else
|
||||||
sent=writev(s,v,headers);
|
sent=writev(s,v,headers);
|
||||||
if (sent==-1) {
|
if (sent==-1) {
|
||||||
if (errno!=EAGAIN)
|
if (errno!=EAGAIN)
|
||||||
@ -84,6 +88,9 @@ eagain:
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (headers) {
|
if (headers) {
|
||||||
|
if (headers==1) /* cosmetics for strace */
|
||||||
|
sent=write(s,v[0].iov_base,v[0].iov_len);
|
||||||
|
else
|
||||||
sent=writev(s,v,headers);
|
sent=writev(s,v,headers);
|
||||||
if (sent==-1) {
|
if (sent==-1) {
|
||||||
if (errno==EAGAIN) {
|
if (errno==EAGAIN) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user