/****************************************************************************** * NETCON_send * Basically calls 'send()' unless we should use SSL * number of chars send is put in *sent */ BOOL NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len, int flags, int *sent /* out */) { if (!NETCON_connected(connection)) return FALSE; if (!connection->useSSL) { *sent = send(connection->socketFD, msg, len, flags); if (*sent == -1) { INTERNET_SetLastError(sock_get_error(errno)); return FALSE; } return TRUE; } else { #ifdef SONAME_LIBSSL if (flags) FIXME("SSL_write doesn't support any flags (%08x)\n", flags); *sent = pSSL_write(connection->ssl_s, msg, len); if (*sent < 1 && len) return FALSE; return TRUE; #else return FALSE; #endif } }
/****************************************************************************** * NETCON_send * Basically calls 'send()' unless we should use SSL * number of chars send is put in *sent */ DWORD NETCON_send(netconn_t *connection, const void *msg, size_t len, int flags, int *sent /* out */) { if (!connection->useSSL) { *sent = send(connection->socketFD, msg, len, flags); if (*sent == -1) return sock_get_error(errno); return ERROR_SUCCESS; } else { #ifdef SONAME_LIBSSL if(!connection->ssl_s) { FIXME("not connected\n"); return ERROR_NOT_SUPPORTED; } if (flags) FIXME("SSL_write doesn't support any flags (%08x)\n", flags); *sent = pSSL_write(connection->ssl_s, msg, len); if (*sent < 1 && len) return ERROR_INTERNET_CONNECTION_ABORTED; return ERROR_SUCCESS; #else return ERROR_NOT_SUPPORTED; #endif } }
BOOL netconn_send( netconn_t *conn, const void *msg, size_t len, int flags, int *sent ) { if (!netconn_connected( conn )) return FALSE; if (conn->secure) { #ifdef SONAME_LIBSSL if (flags) FIXME("SSL_write doesn't support any flags (%08x)\n", flags); *sent = pSSL_write( conn->ssl_conn, msg, len ); if (*sent < 1 && len) return FALSE; return TRUE; #else return FALSE; #endif } if ((*sent = send( conn->socket, msg, len, flags )) == -1) { set_last_error( sock_get_error( errno ) ); return FALSE; } return TRUE; }