-
Notifications
You must be signed in to change notification settings - Fork 645
socks5-proxy won't compile under windows #1293
base: master
Are you sure you want to change the base?
Changes from 6 commits
78b699e
d24e0dd
94a70c4
2322e47
dba1fa4
e0baf50
3b32002
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,9 +19,8 @@ | |
| # IN THE SOFTWARE. | ||
|
|
||
| { | ||
| 'targets': [ | ||
| 'targets': [ | ||
| { | ||
| 'dependencies': ['../../uv.gyp:libuv'], | ||
| 'target_name': 's5-proxy', | ||
| 'type': 'executable', | ||
| 'sources': [ | ||
|
|
@@ -36,7 +35,12 @@ | |
| 'conditions': [ | ||
| ['OS=="win"', { | ||
| 'defines': ['HAVE_UNISTD_H=0'], | ||
| 'sources': ['getopt.c'] | ||
| 'sources': ['getopt.c'], | ||
| 'link_settings': { | ||
| 'libraries': ['-llibuv.lib','-ladvapi32.lib','-lWs2_32.lib','-lPsapi.lib','-lIphlpapi.lib'], | ||
| 'library_dirs': ['../../Debug/lib'] | ||
| }, | ||
| 'include_dirs': ['../../include'] | ||
|
||
| }, { | ||
| 'defines': ['HAVE_UNISTD_H=1'] | ||
| }] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,10 +26,12 @@ | |
| #include "uv.h" | ||
|
|
||
| #include <assert.h> | ||
| #include <netinet/in.h> /* sockaddr_in, sockaddr_in6 */ | ||
| #include <stddef.h> /* size_t, ssize_t */ | ||
| #include <stdint.h> | ||
| #if !defined(_WIN32) | ||
| #include <netinet/in.h> /* sockaddr_in, sockaddr_in6 */ | ||
| #include <sys/socket.h> /* sockaddr */ | ||
| #endif | ||
|
|
||
| struct client_ctx; | ||
|
|
||
|
|
@@ -59,11 +61,11 @@ typedef struct { | |
| } handle; | ||
| uv_timer_t timer_handle; /* For detecting timeouts. */ | ||
| uv_write_t write_req; | ||
| uv_getaddrinfo_t addrinfo_req; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the function conn_connect (client.c@634) calls uv_tcp_connect will reset the connect_req struct (tcp.c@725) but this memory address is share with addr,addr4,addr6, doing so will leads in rewritting the tcp address with junk data, that's why I moved the three req structs outside the union to prevent this behavior. |
||
| uv_connect_t connect_req; | ||
| uv_req_t req; | ||
| /* We only need one of these at a time so make them share memory. */ | ||
| union { | ||
| uv_getaddrinfo_t addrinfo_req; | ||
| uv_connect_t connect_req; | ||
| uv_req_t req; | ||
| struct sockaddr_in6 addr6; | ||
| struct sockaddr_in addr4; | ||
| struct sockaddr addr; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,9 +63,9 @@ const char *_getprogname(void) { | |
| static void parse_opts(server_config *cf, int argc, char **argv) { | ||
| int opt; | ||
|
|
||
| while (-1 != (opt = getopt(argc, argv, "H:hp:"))) { | ||
| while (-1 != (opt = getopt(argc, argv, "b:hp:"))) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. D:...\socks5-proxy\build\Debug>s5-proxy.exe -h s5-proxy.exe [-b ] [-h] [-p ]Options: -b <hostname|address> Bind to this address or hostname. |
||
| switch (opt) { | ||
| case 'H': | ||
| case 'b': | ||
| cf->bind_host = optarg; | ||
| break; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| python ..\..\gyp_uv.py build.gyp --generator-output=build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should probably try placing this above the
targets:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all right