Merge lp:~brianaker/drizzle/libdrizzle-error into lp:drizzle/7.1

Proposed by Brian Aker
Status: Merged
Approved by: Brian Aker
Approved revision: 2542
Merged at revision: 2543
Proposed branch: lp:~brianaker/drizzle/libdrizzle-error
Merge into: lp:drizzle/7.1
Diff against target: 79 lines (+15/-8)
2 files modified
libdrizzle-1.0/t/drizzle_con_st.c (+2/-0)
libdrizzle/conn.cc (+13/-8)
To merge this branch: bzr merge lp:~brianaker/drizzle/libdrizzle-error
Reviewer Review Type Date Requested Status
Drizzle Trunk Pending
Review via email: mp+102904@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libdrizzle-1.0/t/drizzle_con_st.c'
2--- libdrizzle-1.0/t/drizzle_con_st.c 2011-12-14 20:53:40 +0000
3+++ libdrizzle-1.0/t/drizzle_con_st.c 2012-04-20 17:07:31 +0000
4@@ -111,7 +111,9 @@
5 drizzle_test("drizzle_con_connect");
6 ret= drizzle_con_connect(con);
7 if (ret != DRIZZLE_RETURN_COULD_NOT_CONNECT)
8+ {
9 drizzle_test_error("expected COULD_NOT_CONNECT, got: %s\n", drizzle_error(drizzle));
10+ }
11
12 if (drizzle_con_fd(con) != -1)
13 drizzle_test_error("drizzle_con_fd != -1 for unconnected connection");
14
15=== modified file 'libdrizzle/conn.cc'
16--- libdrizzle/conn.cc 2012-04-17 06:03:03 +0000
17+++ libdrizzle/conn.cc 2012-04-20 17:07:31 +0000
18@@ -1557,8 +1557,8 @@
19
20 if (read_size == 0)
21 {
22- drizzle_set_error(con->drizzle, "drizzle_state_read",
23- "lost connection to server (EOF)");
24+ drizzle_set_error(con->drizzle, __func__,
25+ "%s:%d lost connection to server (EOF)", __FILE__, __LINE__);
26 return DRIZZLE_RETURN_LOST_CONNECTION;
27 }
28 else if (read_size == -1)
29@@ -1595,7 +1595,8 @@
30 else if (errno == EPIPE || errno == ECONNRESET)
31 {
32 drizzle_set_error(con->drizzle, __func__,
33- "lost connection to server (%s)", strerror(errno));
34+ "%s:%d lost connection to server (%s)",
35+ __FILE__, __LINE__, strerror(errno));
36 return DRIZZLE_RETURN_LOST_CONNECTION;
37 }
38
39@@ -1676,24 +1677,27 @@
40 write_size, strerror(errno));
41
42 if (write_size == 0)
43- {
44- drizzle_set_error(con->drizzle, __func__, "lost connection to server (EOF)");
45- return DRIZZLE_RETURN_LOST_CONNECTION;
46- }
47+ { }
48 else if (write_size == -1)
49 {
50 if (errno == EAGAIN)
51 {
52 ret= drizzle_con_set_events(con, POLLOUT);
53 if (ret != DRIZZLE_RETURN_OK)
54+ {
55 return ret;
56+ }
57
58 if (con->drizzle->options & DRIZZLE_NON_BLOCKING)
59+ {
60 return DRIZZLE_RETURN_IO_WAIT;
61+ }
62
63 ret= drizzle_con_wait(con->drizzle);
64 if (ret != DRIZZLE_RETURN_OK)
65+ {
66 return ret;
67+ }
68
69 continue;
70 }
71@@ -1703,7 +1707,8 @@
72 }
73 else if (errno == EPIPE || errno == ECONNRESET)
74 {
75- drizzle_set_error(con->drizzle, __func__, "lost connection to server (%s)", strerror(errno));
76+ drizzle_set_error(con->drizzle, __func__, "%s:%d lost connection to server (%s)",
77+ __FILE__, __LINE__, strerror(errno));
78 return DRIZZLE_RETURN_LOST_CONNECTION;
79 }
80

Subscribers

People subscribed via source and target branches

to all changes: