aboutsummaryrefslogtreecommitdiff
path: root/src/usocket.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/usocket.c')
-rw-r--r--src/usocket.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/usocket.c b/src/usocket.c
index 99e551b..8adc573 100644
--- a/src/usocket.c
+++ b/src/usocket.c
@@ -211,6 +211,8 @@ int socket_send(p_socket ps, const char *data, size_t count,
211 err = errno; 211 err = errno;
212 /* EPIPE means the connection was closed */ 212 /* EPIPE means the connection was closed */
213 if (err == EPIPE) return IO_CLOSED; 213 if (err == EPIPE) return IO_CLOSED;
214 /* EPROTOTYPE means the connection is being closed (on Yosemite!)*/
215 if (err == EPROTOTYPE) continue;
214 /* we call was interrupted, just try again */ 216 /* we call was interrupted, just try again */
215 if (err == EINTR) continue; 217 if (err == EINTR) continue;
216 /* if failed fatal reason, report error */ 218 /* if failed fatal reason, report error */
@@ -239,6 +241,7 @@ int socket_sendto(p_socket ps, const char *data, size_t count, size_t *sent,
239 } 241 }
240 err = errno; 242 err = errno;
241 if (err == EPIPE) return IO_CLOSED; 243 if (err == EPIPE) return IO_CLOSED;
244 if (err == EPROTOTYPE) continue;
242 if (err == EINTR) continue; 245 if (err == EINTR) continue;
243 if (err != EAGAIN) return err; 246 if (err != EAGAIN) return err;
244 if ((err = socket_waitfd(ps, WAITFD_W, tm)) != IO_DONE) return err; 247 if ((err = socket_waitfd(ps, WAITFD_W, tm)) != IO_DONE) return err;
@@ -317,6 +320,8 @@ int socket_write(p_socket ps, const char *data, size_t count,
317 err = errno; 320 err = errno;
318 /* EPIPE means the connection was closed */ 321 /* EPIPE means the connection was closed */
319 if (err == EPIPE) return IO_CLOSED; 322 if (err == EPIPE) return IO_CLOSED;
323 /* EPROTOTYPE means the connection is being closed (on Yosemite!)*/
324 if (err == EPROTOTYPE) continue;
320 /* we call was interrupted, just try again */ 325 /* we call was interrupted, just try again */
321 if (err == EINTR) continue; 326 if (err == EINTR) continue;
322 /* if failed fatal reason, report error */ 327 /* if failed fatal reason, report error */
@@ -410,7 +415,9 @@ const char *socket_strerror(int err) {
410 case ECONNABORTED: return PIE_CONNABORTED; 415 case ECONNABORTED: return PIE_CONNABORTED;
411 case ECONNRESET: return PIE_CONNRESET; 416 case ECONNRESET: return PIE_CONNRESET;
412 case ETIMEDOUT: return PIE_TIMEDOUT; 417 case ETIMEDOUT: return PIE_TIMEDOUT;
413 default: return strerror(err); 418 default: {
419 return strerror(err);
420 }
414 } 421 }
415} 422}
416 423