This repository has been archived by the owner on Nov 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This picks up facebookarchive/nailgun#57 and facebookarchive/nailgun#58 to actually close #262. Test Plan: CI
- Loading branch information
Showing
1 changed file
with
10 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ | |
#include <string.h> | ||
#include <unistd.h> | ||
#include <fcntl.h> | ||
#include <errno.h> | ||
|
||
#define NAILGUN_VERSION "0.9.0" | ||
|
||
|
@@ -56,6 +57,12 @@ | |
typedef unsigned int SOCKET; | ||
#endif | ||
|
||
#ifdef __APPLE__ | ||
#define SEND_FLAGS 0 | ||
#else | ||
#define SEND_FLAGS MSG_NOSIGNAL | ||
#endif | ||
|
||
#ifndef MIN | ||
#define MIN(a,b) ((a<b)?(a):(b)) | ||
#endif | ||
|
@@ -191,9 +198,9 @@ int sendAll(SOCKET s, char *buf, int len) { | |
int total = 0; | ||
int bytesleft = len; | ||
int n = 0; | ||
|
||
while(total < len) { | ||
n = send(s, buf+total, bytesleft, 0); | ||
n = send(s, buf+total, bytesleft, SEND_FLAGS); | ||
This comment has been minimized.
Sorry, something went wrong.
denji
|
||
|
||
if (n == -1) { | ||
break; | ||
|
@@ -235,7 +242,7 @@ void sendChunk(unsigned int size, char chunkType, char* buf) { | |
bytesSent = sendAll(nailgunsocket, header, CHUNK_HEADER_LEN); | ||
if (bytesSent != 0 && size > 0) { | ||
bytesSent = sendAll(nailgunsocket, buf, size); | ||
} else if (bytesSent == 0) { | ||
} else if (bytesSent == 0 && (chunkType != CHUNKTYPE_HEARTBEAT || errno != EPIPE)) { | ||
perror("send"); | ||
handleSocketClose(); | ||
} | ||
|
This comment has been minimized.
Sorry, something went wrong.
denjiJul 13, 2015
This comment has been minimized.
Sorry, something went wrong.
sdwilshJul 13, 2015
Author ContributorPlease make that pull request upstream and we'd be happy to update nailgun here.