Skip to content

Commit 3941965

Browse files
committed
integrated changes from main repository
1 parent 431807f commit 3941965

6 files changed

Lines changed: 36 additions & 25 deletions

File tree

Foundation/include/Poco/Format.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// Format.h
33
//
4-
// $Id: //poco/1.3/Foundation/include/Poco/Format.h#2 $
4+
// $Id: //poco/1.3/Foundation/include/Poco/Format.h#3 $
55
//
66
// Library: Foundation
77
// Package: Core
@@ -109,7 +109,7 @@ std::string Foundation_API format(const std::string& fmt, const Any& value);
109109
/// * l argument is long (d, i), unsigned long (o, u, x, X) or long double (e, E, f, g, G)
110110
/// * L argument is long long (d, i), unsigned long long (o, u, x, X)
111111
/// * h argument is short (d, i), unsigned short (o, u, x, X) or float (e, E, f, g, G)
112-
/// * * argument is any signed or unsigned integer (d, i, o, x, X)
112+
/// * ? argument is any signed or unsigned int, short, long, or 64-bit integer (d, i, o, x, X)
113113
///
114114
/// The width argument is a nonnegative decimal integer controlling the minimum number of characters printed.
115115
/// If the number of characters in the output value is less than the specified width, blanks or

Foundation/src/Format.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// Format.cpp
33
//
4-
// $Id: //poco/1.3/Foundation/src/Format.cpp#2 $
4+
// $Id: //poco/1.3/Foundation/src/Format.cpp#3 $
55
//
66
// Library: Foundation
77
// Package: Core
@@ -113,7 +113,7 @@ namespace
113113
case 'l':
114114
case 'h':
115115
case 'L':
116-
case '*': mod = *itFmt++; break;
116+
case '?': mod = *itFmt++; break;
117117
}
118118
}
119119
return mod;
@@ -186,7 +186,7 @@ namespace
186186
case 'l': str << AnyCast<long>(*itVal++); break;
187187
case 'L': str << AnyCast<Int64>(*itVal++); break;
188188
case 'h': str << AnyCast<short>(*itVal++); break;
189-
case '*': writeAnyInt(str, *itVal++); break;
189+
case '?': writeAnyInt(str, *itVal++); break;
190190
default: str << AnyCast<int>(*itVal++); break;
191191
}
192192
break;
@@ -199,7 +199,7 @@ namespace
199199
case 'l': str << AnyCast<unsigned long>(*itVal++); break;
200200
case 'L': str << AnyCast<UInt64>(*itVal++); break;
201201
case 'h': str << AnyCast<unsigned short>(*itVal++); break;
202-
case '*': writeAnyInt(str, *itVal++); break;
202+
case '?': writeAnyInt(str, *itVal++); break;
203203
default: str << AnyCast<unsigned>(*itVal++); break;
204204
}
205205
break;

Foundation/testsuite/src/FormatTest.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// FormatTest.cpp
33
//
4-
// $Id: //poco/1.3/Foundation/testsuite/src/FormatTest.cpp#2 $
4+
// $Id: //poco/1.3/Foundation/testsuite/src/FormatTest.cpp#3 $
55
//
66
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
77
// All rights reserved.
@@ -214,55 +214,55 @@ void FormatTest::testInt()
214214
void FormatTest::testAnyInt()
215215
{
216216
char c = 42;
217-
std::string s(format("%*i", c));
217+
std::string s(format("%?i", c));
218218
assert (s == "42");
219219

220220
signed char sc = -42;
221-
s = format("%*i", sc);
221+
s = format("%?i", sc);
222222
assert (s == "-42");
223223

224224
unsigned char uc = 65;
225-
s = format("%*i", uc);
225+
s = format("%?i", uc);
226226
assert (s == "65");
227227

228228
short ss = -134;
229-
s = format("%*i", ss);
229+
s = format("%?i", ss);
230230
assert (s == "-134");
231231

232232
unsigned short us = 200;
233-
s = format("%*i", us);
233+
s = format("%?i", us);
234234
assert (s == "200");
235235

236236
int i = -12345;
237-
s = format("%*i", i);
237+
s = format("%?i", i);
238238
assert (s == "-12345");
239239

240240
unsigned ui = 12345;
241-
s = format("%*i", ui);
241+
s = format("%?i", ui);
242242
assert (s == "12345");
243243

244244
long l = -54321;
245-
s = format("%*i", l);
245+
s = format("%?i", l);
246246
assert (s == "-54321");
247247

248248
unsigned long ul = 54321;
249-
s = format("%*i", ul);
249+
s = format("%?i", ul);
250250
assert (s == "54321");
251251

252252
Int64 i64 = -12345678;
253-
s = format("%*i", i64);
253+
s = format("%?i", i64);
254254
assert (s == "-12345678");
255255

256256
UInt64 ui64 = 12345678;
257-
s = format("%*i", ui64);
257+
s = format("%?i", ui64);
258258
assert (s == "12345678");
259259

260260
ss = 0x42;
261-
s = format("%*x", ss);
261+
s = format("%?x", ss);
262262
assert (s == "42");
263263

264264
ss = 042;
265-
s = format("%*o", ss);
265+
s = format("%?o", ss);
266266
assert (s == "42");
267267
}
268268

Net/src/IPAddress.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// IPAddress.cpp
33
//
4-
// $Id: //poco/1.3/Net/src/IPAddress.cpp#1 $
4+
// $Id: //poco/1.3/Net/src/IPAddress.cpp#2 $
55
//
66
// Library: Net
77
// Package: NetCore
@@ -300,7 +300,7 @@ class IPv6AddressImpl: public IPAddressImpl
300300
}
301301
}
302302
if (i > 0) result.append(":");
303-
if (i < 8) result.append(NumberFormatter::formatHex(words[i++]));
303+
if (i < 8) result.append(NumberFormatter::formatHex(ntohs(words[i++])));
304304
}
305305
return result;
306306
}

Net/src/SocketNotifier.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// SocketNotifier.cpp
33
//
4-
// $Id: //poco/1.3/Net/src/SocketNotifier.cpp#1 $
4+
// $Id: //poco/1.3/Net/src/SocketNotifier.cpp#2 $
55
//
66
// Library: Net
77
// Package: Reactor
@@ -87,9 +87,20 @@ void SocketNotifier::removeObserver(SocketReactor* pReactor, const Poco::Abstrac
8787

8888
void SocketNotifier::dispatch(SocketNotification* pNotification)
8989
{
90+
static Socket nullSocket;
91+
9092
pNotification->setSocket(_socket);
9193
pNotification->duplicate();
92-
_nc.postNotification(pNotification);
94+
try
95+
{
96+
_nc.postNotification(pNotification);
97+
}
98+
catch (...)
99+
{
100+
pNotification->setSocket(nullSocket);
101+
throw;
102+
}
103+
pNotification->setSocket(nullSocket);
93104
}
94105

95106

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3-20061227 (2006-12-27)
1+
1.3-20070104-ssl (2007-01-04)

0 commit comments

Comments
 (0)