Windows: the loop's socket results in the type the socket calls return

ssize_t does not exist under MSVC, and the socket function table
already spells its send and recv results int there and ssize_t
elsewhere. That type is now named SOCKRET, beside SASIZETYPE, and the
event loop's copies of it use the name, so the MSVC build compiles
again.
This commit is contained in:
Vladimir Dubrovin 2026-11-02 12:11:09 +03:00
parent 235f899668
commit 0cf5dfc6a3
3 changed files with 4 additions and 2 deletions

View File

@ -555,7 +555,7 @@ static void cbfail(struct cbmap *m, int side, int writing){
/* Statistics of what went through a way, as sockmap() counts them, and
the bandwidth limits' pause: the client's data once written to the
server, the server's once read. A read counts for the grace. */
static void cbcount(struct cbmap *m, struct cbway *w, int written, ssize_t n){
static void cbcount(struct cbmap *m, struct cbway *w, int written, SOCKRET n){
struct clientparam *param = m->param;
int sl = 0;
@ -603,7 +603,7 @@ static int cbway(struct cbmap *m, struct cbway *w){
unsigned char *buf;
unsigned *inbuf, *offset, size;
uint64_t inb, room;
ssize_t n;
SOCKRET n;
if(!w->left) return 0;
cbbuf(param, w->src, &buf, &inbuf, &offset, &size);

View File

@ -62,6 +62,7 @@
#include <io.h>
#include <process.h>
#define SASIZETYPE int
#define SOCKRET int /* what a socket call returns: moved bytes or -1 */
#define SHUT_RDWR SD_BOTH
#define SHUT_WR SD_SEND
#define SHUT_RD SD_RECEIVE

View File

@ -35,6 +35,7 @@ extern "C" {
#include <net/if.h>
#endif
#define SASIZETYPE socklen_t
#define SOCKRET ssize_t /* what a socket call returns: moved bytes or -1 */
#define SOCKET int
#define INVALID_SOCKET (-1)
#define _3proxy_mutex_t pthread_mutex_t