| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent fe3c85f commit 1131241
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,8 +1,18 @@ | |||
| 1 | 1 | /* Hint to the compiler that a function never returns */ | |
| 2 | 2 | #define NGHTTP2_NORETURN | |
| 3 | 3 | ||
| 4 | - /* Define to `int' if <sys/types.h> does not define. */ | ||
| 5 | - #define ssize_t int | ||
| 4 | + /* Edited to match src/node.h. */ | ||
| 5 | + #include <stdint.h> | ||
| 6 | + | ||
| 7 | + #ifdef _WIN32 | ||
| 8 | + #if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED) | ||
| 9 | + typedef intptr_t ssize_t; | ||
| 10 | + # define _SSIZE_T_ | ||
| 11 | + # define _SSIZE_T_DEFINED | ||
| 12 | + #endif | ||
| 13 | + #else // !_WIN32 | ||
| 14 | + # include <sys/types.h> // size_t, ssize_t | ||
| 15 | + #endif // _WIN32 | ||
| 6 | 16 | ||
| 7 | 17 | /* Define to 1 if you have the `std::map::emplace`. */ | |
| 8 | 18 | #define HAVE_STD_MAP_EMPLACE 1 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -178,7 +178,6 @@ NODE_EXTERN v8::Local<v8::Value> MakeCallback( | |||
| 178 | 178 | #endif | |
| 179 | 179 | ||
| 180 | 180 | #ifdef _WIN32 | |
| 181 | - // TODO(tjfontaine) consider changing the usage of ssize_t to ptrdiff_t | ||
| 182 | 181 | #if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED) | |
| 183 | 182 | typedef intptr_t ssize_t; | |
| 184 | 183 | # define _SSIZE_T_ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -775,13 +775,7 @@ inline ssize_t Http2Session::Write(const uv_buf_t* bufs, size_t nbufs) { | |||
| 775 | 775 | bufs[n].len); | |
| 776 | 776 | CHECK_NE(ret, NGHTTP2_ERR_NOMEM); | |
| 777 | 777 | ||
| 778 | - // If there is an error calling any of the callbacks, ret will be a | ||
| 779 | - // negative number identifying the error code. This can happen, for | ||
| 780 | - // instance, if the session is destroyed during any of the JS callbacks | ||
| 781 | - // Note: if ssize_t is not defined (e.g. on Win32), nghttp2 will typedef | ||
| 782 | - // ssize_t to int. Cast here so that the < 0 check actually works on | ||
| 783 | - // Windows. | ||
| 784 | - if (static_cast<int>(ret) < 0) | ||
| 778 | + if (ret < 0) | ||
| 785 | 779 | return ret; | |
| 786 | 780 | ||
| 787 | 781 | total += ret; | |
@@ -1693,7 +1687,7 @@ void Http2Session::OnStreamReadImpl(ssize_t nread, | |||
| 1693 | 1687 | // ssize_t to int. Cast here so that the < 0 check actually works on | |
| 1694 | 1688 | // Windows. | |
| 1695 | 1689 | if (static_cast<int>(ret) < 0) { | |
| 1696 | - DEBUG_HTTP2SESSION2(session, "fatal error receiving data: %d", ret); | ||
| 1690 | + DEBUG_HTTP2SESSION2(this, "fatal error receiving data: %d", ret); | ||
| 1697 | 1691 | ||
| 1698 | 1692 | Local<Value> argv[1] = { | |
| 1699 | 1693 | Integer::New(isolate, ret), | |
| Back | FazBrowse Home | New Git URL |
0 commit comments