Skip to content

Instantly share code, notes, and snippets.

diff --git a/src/spawn_sync.cc b/src/spawn_sync.cc
index de0d180..bf20ee3 100644
--- a/src/spawn_sync.cc
+++ b/src/spawn_sync.cc
@@ -1025,6 +1025,7 @@ void SyncProcessRunner::ExitCallback(uv_process_t* handle,
int64_t exit_status,
int term_signal) {
SyncProcessRunner* self = reinterpret_cast<SyncProcessRunner*>(handle->data);
+ uv_close((uv_handle_t*)handle, NULL);
(merge-review)saghul@alpha:~/src/node
$ ./out/Debug/node test/simple/test-child-process-execsync.js
node: ../src/spawn_sync.cc:518: void node::SyncProcessRunner::CloseHandlesAndDeleteLoop(): Assertion `uv_loop_close(uv_loop_)==0' failed.
Aborted (core dumped)
(merge-review)saghul@alpha:~/src/node
$ gdb ./out/Debug/node core
GNU gdb (GDB) 7.6.2 (Debian 7.6.2-1)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
diff --git a/src/unix/fs.c b/src/unix/fs.c
index ce8798c..b06f992 100644
--- a/src/unix/fs.c
+++ b/src/unix/fs.c
@@ -598,7 +598,7 @@ static ssize_t uv__fs_write(uv_fs_t* req) {
# endif
written = 0;
index = 0;
- r = 1;
+ r = 0;
diff --git a/modules/mediaproxy/mediaproxy.c b/modules/mediaproxy/mediaproxy.c
index 625372b..9c217c7 100644
--- a/modules/mediaproxy/mediaproxy.c
+++ b/modules/mediaproxy/mediaproxy.c
@@ -448,7 +448,7 @@ get_cseq_number(struct sip_msg *msg, str *cseq)
{
struct cell *trans = tm_api.t_gett();
- if (msg->first_line.type == SIP_REPLY && trans != NULL && trans != T_UNDEFINED) {
+ if (trans != T_NULL_CELL && trans != T_UNDEFINED && trans->cseq_n.s != NULL && trans->cseq_n.len != 0) {
diff --git a/modules/mediaproxy/mediaproxy.c b/modules/mediaproxy/mediaproxy.c
index 625372b..3e32c0c 100644
--- a/modules/mediaproxy/mediaproxy.c
+++ b/modules/mediaproxy/mediaproxy.c
@@ -446,24 +446,15 @@ get_callid(struct sip_msg* msg, str *cid)
static Bool
get_cseq_number(struct sip_msg *msg, str *cseq)
{
- struct cell *trans = tm_api.t_gett();
-
diff --git a/src/unix/tcp.c b/src/unix/tcp.c
index 2c36dc3..9c50b2d 100644
--- a/src/unix/tcp.c
+++ b/src/unix/tcp.c
@@ -232,7 +232,9 @@ int uv_tcp_listen(uv_tcp_t* tcp, int backlog, uv_connection_cb cb) {
int uv__tcp_nodelay(int fd, int on) {
- return setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on));
+ if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)))
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
import fibers
import threading
def test(*args):
return 42
def run_test():
@saghul
saghul / t.py
Created November 27, 2013 17:18
import erequests
urls = [
'http://www.heroku.com',
'http://tablib.org',
'http://httpbin.org',
'http://python-requests.org',
'http://kennethreitz.com'
]
@saghul
saghul / ts.py
Created November 27, 2013 08:27
import erequests
import os
HTTPBIN_URL = os.environ.get('HTTPBIN_URL', 'http://httpbin.org/')
def httpbin(*suffix):
"""Returns url for HTTPBIN resource."""
return HTTPBIN_URL + '/'.join(suffix)