ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro-Mysql/Mysql.xs
(Generate patch)

Comparing Coro-Mysql/Mysql.xs (file contents):
Revision 1.2 by root, Tue Jun 16 17:28:00 2009 UTC vs.
Revision 1.3 by root, Sat Jun 20 20:43:44 2009 UTC

5#include <mysql.h> 5#include <mysql.h>
6 6
7#include "EXTERN.h" 7#include "EXTERN.h"
8#include "perl.h" 8#include "perl.h"
9#include "XSUB.h" 9#include "XSUB.h"
10
11#define IN_DESTRUCT PL_dirty
10 12
11typedef U16 uint16; 13typedef U16 uint16;
12 14
13/* cached function gv's */ 15/* cached function gv's */
14static CV *readable, *writable; 16static CV *readable, *writable;
149} 151}
150 152
151void 153void
152_unpatch (IV sock) 154_unpatch (IV sock)
153 CODE: 155 CODE:
154{ 156 if (IN_DESTRUCT)
157 {
158 /* we currently leak data during global destruction */
159 /* perl makes it extremely hard to do otherwise, though */
155 MYSQL *my = (MYSQL *)sock; 160 MYSQL *my = (MYSQL *)sock;
156 Vio *vio = my->net.vio; 161 Vio *vio = my->net.vio;
157 my_bool dummy; 162 my_bool dummy;
158 163
159 if (vio->read != our_read) 164 if (vio->read != our_read)
160 croak ("vio.read has unexpected content during unpatch - wtf?"); 165 croak ("vio.read has unexpected content during unpatch - wtf?");
161 166
162 if (vio->write != our_write) 167 if (vio->write != our_write)
163 croak ("vio.write has unexpected content during unpatch - wtf?"); 168 croak ("vio.write has unexpected content during unpatch - wtf?");
164 169
165 SvREFCNT_dec (OURDATAPTR->corosocket); 170 SvREFCNT_dec (OURDATAPTR->corosocket);
166 171
167 Safefree (OURDATAPTR); 172 Safefree (OURDATAPTR);
168 173
169 vio->read = vio_read; 174 vio->read = vio_read;
170 vio->write = vio_write; 175 vio->write = vio_write;
171} 176 }
172 177
173 178
174 179

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines