Changeset 1088:1d1a20a0779d in freeDiameter for extensions/dbg_interactive
- Timestamp:
- May 5, 2013, 4:25:27 AM (11 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- extensions/dbg_interactive
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/dbg_interactive/dictionary.i
r979 r1088 60 60 } 61 61 void dump() { 62 fd_dict_dump($self); 62 char * buf = NULL; 63 size_t len; 64 printf("%s", fd_dict_dump(&buf, &len, NULL, $self)); 65 free(buf); 63 66 } 64 67 PyObject * vendors_list() { … … 128 131 %extend dict_object { 129 132 void dump() { 130 fd_dict_dump_object($self); 133 char * buf = NULL; 134 size_t len; 135 printf("%s", fd_dict_dump_object(&buf, &len, NULL, $self)); 136 free(buf); 131 137 } 132 138 enum dict_object_type gettype() { -
extensions/dbg_interactive/endpoints.i
r978 r1088 126 126 127 127 void dump() { 128 fd_ep_dump_one( "", $self ); 128 char * buf = NULL; 129 size_t len; 130 printf("%s", fd_ep_dump_one(&buf, &len, NULL, $self)); 131 free(buf); 129 132 } 130 133 } -
extensions/dbg_interactive/messages.i
r1078 r1088 291 291 /* Dump */ 292 292 void dump (int tree = 1) { 293 if (tree)294 fd_msg_dump_walk(0, $self);295 else296 fd_msg_dump_one(0, $self);293 char * buf = NULL; 294 size_t len; 295 printf("%s", fd_msg_dump_treeview(&buf, &len, NULL, $self, NULL, 0, tree)); 296 free(buf); 297 297 } 298 298 … … 570 570 /* Dump */ 571 571 void dump (int tree = 1) { 572 if (tree)573 fd_msg_dump_walk(0, $self);574 else575 fd_msg_dump_one(0, $self);572 char * buf = NULL; 573 size_t len; 574 printf("%s", fd_msg_dump_treeview(&buf, &len, NULL, $self, NULL, 0, tree)); 575 free(buf); 576 576 } 577 577 -
extensions/dbg_interactive/sessions.i
r1013 r1088 39 39 40 40 %{ 41 struct sess_state { 42 PyObject * pystate; 43 }; 44 41 45 /* call it (might be called from a different thread than the interpreter, when session times out) */ 42 static void call_the_python_cleanup_callback(s ession_state * state, os0_t sid, void * cb) {46 static void call_the_python_cleanup_callback(struct sess_state * state, os0_t sid, void * cb) { 43 47 PyObject *result; 44 48 if (!cb) { … … 67 71 Py_XINCREF(PyCb); 68 72 69 ret = fd_sess_handler_create _internal ( &hdl, call_the_python_cleanup_callback, PyCb );73 ret = fd_sess_handler_create ( &hdl, call_the_python_cleanup_callback, NULL, PyCb ); 70 74 if (ret != 0) { 71 75 DI_ERROR(ret, NULL, NULL); … … 87 91 } 88 92 void dump() { 89 fd_sess_dump_hdl(0, $self); 93 char * buf = NULL; 94 size_t len; 95 printf("%s", fd_sess_dump_hdl(&buf, &len, NULL, $self)); 96 free(buf); 90 97 } 91 98 } … … 166 173 } 167 174 void dump() { 168 fd_sess_dump(0, $self); 175 char * buf = NULL; 176 size_t len = 0; 177 printf("%s", fd_sess_dump(&buf, &len, NULL, $self, 1) ); 178 free(buf); 169 179 } 170 180 void store(struct session_handler * handler, PyObject * DISOWN) { 171 181 int ret; 172 void * store = DISOWN; 182 struct sess_state * st = NULL; 183 st = malloc(sizeof(struct sess_state)); 184 st->pystate = DISOWN; 173 185 Py_XINCREF(DISOWN); 174 ret = fd_sess_state_store _internal(handler, $self, (void *) &store);186 ret = fd_sess_state_store(handler, $self, (void *) &st); 175 187 if (ret != 0) { 176 188 DI_ERROR(ret, NULL, NULL); … … 180 192 PyObject * retrieve(struct session_handler * handler) { 181 193 int ret; 194 struct sess_state * st = NULL; 182 195 PyObject * state = NULL; 183 ret = fd_sess_state_retrieve_internal(handler, $self, (void *) &st ate);184 if (ret != 0) { 185 DI_ERROR(ret, NULL, NULL); 186 return NULL; 187 } 188 if (st ate== NULL) {196 ret = fd_sess_state_retrieve_internal(handler, $self, (void *) &st); 197 if (ret != 0) { 198 DI_ERROR(ret, NULL, NULL); 199 return NULL; 200 } 201 if (st == NULL) { 189 202 Py_INCREF(Py_None); 190 203 return Py_None; 191 204 } 205 state = st->pystate; 206 free(st); 192 207 return state; 193 208 }
Note: See TracChangeset
for help on using the changeset viewer.