Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
b40445e7
Commit
b40445e7
authored
Aug 26, 2018
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove or defer TODO(soon)s that I'm not going to do now.
parent
620ba371
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
20 additions
and
22 deletions
+20
-22
json-test.capnp
c++/src/capnp/compat/json-test.capnp
+0
-2
json.c++
c++/src/capnp/compat/json.c++
+2
-2
http-test.c++
c++/src/kj/compat/http-test.c++
+5
-5
http.c++
c++/src/kj/compat/http.c++
+2
-2
http.h
c++/src/kj/compat/http.h
+1
-1
tls.c++
c++/src/kj/compat/tls.c++
+1
-1
url.c++
c++/src/kj/compat/url.c++
+2
-2
debug.c++
c++/src/kj/debug.c++
+2
-2
filesystem-disk-test.c++
c++/src/kj/filesystem-disk-test.c++
+1
-1
filesystem-disk-win32.c++
c++/src/kj/filesystem-disk-win32.c++
+1
-1
mutex-test.c++
c++/src/kj/mutex-test.c++
+1
-1
mutex.h
c++/src/kj/mutex.h
+2
-2
No files found.
c++/src/capnp/compat/json-test.capnp
View file @
b40445e7
...
@@ -114,5 +114,3 @@ enum TestJsonAnnotatedEnum {
...
@@ -114,5 +114,3 @@ enum TestJsonAnnotatedEnum {
baz @2 $Json.name("renamed-baz");
baz @2 $Json.name("renamed-baz");
qux @3;
qux @3;
}
}
# TODO(now): enums
c++/src/capnp/compat/json.c++
View file @
b40445e7
...
@@ -214,8 +214,8 @@ kj::String JsonCodec::encodeRaw(JsonValue::Reader value) const {
...
@@ -214,8 +214,8 @@ kj::String JsonCodec::encodeRaw(JsonValue::Reader value) const {
}
}
void
JsonCodec
::
encode
(
DynamicValue
::
Reader
input
,
Type
type
,
JsonValue
::
Builder
output
)
const
{
void
JsonCodec
::
encode
(
DynamicValue
::
Reader
input
,
Type
type
,
JsonValue
::
Builder
output
)
const
{
// TODO(so
on
): For interfaces, check for handlers on superclasses, per documentation...
// TODO(so
meday
): For interfaces, check for handlers on superclasses, per documentation...
// TODO(so
on
): For branded types, should we check for handlers on the generic?
// TODO(so
meday
): For branded types, should we check for handlers on the generic?
// TODO(someday): Allow registering handlers for "all structs", "all lists", etc?
// TODO(someday): Allow registering handlers for "all structs", "all lists", etc?
KJ_IF_MAYBE
(
handler
,
impl
->
typeHandlers
.
find
(
type
))
{
KJ_IF_MAYBE
(
handler
,
impl
->
typeHandlers
.
find
(
type
))
{
(
*
handler
)
->
encodeBase
(
*
this
,
input
,
output
);
(
*
handler
)
->
encodeBase
(
*
this
,
input
,
output
);
...
...
c++/src/kj/compat/http-test.c++
View file @
b40445e7
...
@@ -2809,11 +2809,11 @@ KJ_TEST("HttpClient connection management") {
...
@@ -2809,11 +2809,11 @@ KJ_TEST("HttpClient connection management") {
KJ_EXPECT
(
count
==
0
);
KJ_EXPECT
(
count
==
0
);
#if __linux__
#if __linux__
// TODO(so
on): Figure out why this doesn't work on Windows and is flakey on Mac. My guess is that
// TODO(so
meday): Figure out why this doesn't work on Windows and is flakey on Mac. My guess is
// th
e closing of the TCP connection propagates synchronously on Linux so that by the time w
e
// th
at the closing of the TCP connection propagates synchronously on Linux so that by the tim
e
//
poll() the EventPort it reports the client end of the connection has reached EOF, whereas on
//
we poll() the EventPort it reports the client end of the connection has reached EOF, whereas
//
Mac and Windows this propagation probably involves some concurrent process which may or may
//
on Mac and Windows this propagation probably involves some concurrent process which may or
// not complete before we poll(). A solution in this case would be to use a dummy in-memory
//
may
not complete before we poll(). A solution in this case would be to use a dummy in-memory
// ConnectionReceiver that returns in-memory pipes (see UnbufferedPipe earlier in this file),
// ConnectionReceiver that returns in-memory pipes (see UnbufferedPipe earlier in this file),
// so that we don't rely on any non-local behavior. Another solution would be to pause for
// so that we don't rely on any non-local behavior. Another solution would be to pause for
// a short time, maybe.
// a short time, maybe.
...
...
c++/src/kj/compat/http.c++
View file @
b40445e7
...
@@ -1570,7 +1570,7 @@ kj::Own<kj::AsyncInputStream> HttpInputStream::getEntityBody(
...
@@ -1570,7 +1570,7 @@ kj::Own<kj::AsyncInputStream> HttpInputStream::getEntityBody(
KJ_IF_MAYBE
(
te
,
headers
.
get
(
HttpHeaderId
::
TRANSFER_ENCODING
))
{
KJ_IF_MAYBE
(
te
,
headers
.
get
(
HttpHeaderId
::
TRANSFER_ENCODING
))
{
// TODO(someday): Support plugable transfer encodings? Or at least gzip?
// TODO(someday): Support plugable transfer encodings? Or at least gzip?
// TODO(so
on
): Support stacked transfer encodings, e.g. "gzip, chunked".
// TODO(so
meday
): Support stacked transfer encodings, e.g. "gzip, chunked".
if
(
fastCaseCmp
<
'c'
,
'h'
,
'u'
,
'n'
,
'k'
,
'e'
,
'd'
>
(
te
->
cStr
()))
{
if
(
fastCaseCmp
<
'c'
,
'h'
,
'u'
,
'n'
,
'k'
,
'e'
,
'd'
>
(
te
->
cStr
()))
{
return
kj
::
heap
<
HttpChunkedEntityReader
>
(
*
this
);
return
kj
::
heap
<
HttpChunkedEntityReader
>
(
*
this
);
}
else
{
}
else
{
...
@@ -1588,7 +1588,7 @@ kj::Own<kj::AsyncInputStream> HttpInputStream::getEntityBody(
...
@@ -1588,7 +1588,7 @@ kj::Own<kj::AsyncInputStream> HttpInputStream::getEntityBody(
}
}
KJ_IF_MAYBE
(
c
,
headers
.
get
(
HttpHeaderId
::
CONNECTION
))
{
KJ_IF_MAYBE
(
c
,
headers
.
get
(
HttpHeaderId
::
CONNECTION
))
{
// TODO(so
on
): Connection header can actually have multiple tokens... but no one ever uses
// TODO(so
meday
): Connection header can actually have multiple tokens... but no one ever uses
// that feature?
// that feature?
if
(
fastCaseCmp
<
'c'
,
'l'
,
'o'
,
's'
,
'e'
>
(
c
->
cStr
()))
{
if
(
fastCaseCmp
<
'c'
,
'l'
,
'o'
,
's'
,
'e'
>
(
c
->
cStr
()))
{
return
kj
::
heap
<
HttpConnectionCloseEntityReader
>
(
*
this
);
return
kj
::
heap
<
HttpConnectionCloseEntityReader
>
(
*
this
);
...
...
c++/src/kj/compat/http.h
View file @
b40445e7
...
@@ -152,7 +152,7 @@ public:
...
@@ -152,7 +152,7 @@ public:
//
//
// HttpHeaderId::HOST
// HttpHeaderId::HOST
//
//
// TODO(so
on
): Fill this out with more common headers.
// TODO(so
meday
): Fill this out with more common headers.
#define DECLARE_HEADER(id, name) \
#define DECLARE_HEADER(id, name) \
static const HttpHeaderId id;
static const HttpHeaderId id;
...
...
c++/src/kj/compat/tls.c++
View file @
b40445e7
...
@@ -183,7 +183,7 @@ public:
...
@@ -183,7 +183,7 @@ public:
void
shutdownWrite
()
override
{
void
shutdownWrite
()
override
{
KJ_REQUIRE
(
shutdownTask
==
nullptr
,
"already called shutdownWrite()"
);
KJ_REQUIRE
(
shutdownTask
==
nullptr
,
"already called shutdownWrite()"
);
// TODO(
soon
): shutdownWrite() is problematic because it doesn't return a promise. It was
// TODO(
0.8
): shutdownWrite() is problematic because it doesn't return a promise. It was
// designed to assume that it would only be called after all writes are finished and that
// designed to assume that it would only be called after all writes are finished and that
// there was no reason to block at that point, but SSL sessions don't fit this since they
// there was no reason to block at that point, but SSL sessions don't fit this since they
// actually have to send a shutdown message.
// actually have to send a shutdown message.
...
...
c++/src/kj/compat/url.c++
View file @
b40445e7
...
@@ -72,8 +72,8 @@ constexpr auto NOT_SCHEME_CHARS = SCHEME_CHARS.invert();
...
@@ -72,8 +72,8 @@ constexpr auto NOT_SCHEME_CHARS = SCHEME_CHARS.invert();
constexpr
auto
HOST_CHARS
=
ALPHAS
.
orGroup
(
DIGITS
).
orAny
(
".-:[]_"
);
constexpr
auto
HOST_CHARS
=
ALPHAS
.
orGroup
(
DIGITS
).
orAny
(
".-:[]_"
);
// [] is for ipv6 literals.
// [] is for ipv6 literals.
// _ is not allowed in domain names, but the WHATWG URL spec allows it in hostnames, so we do, too.
// _ is not allowed in domain names, but the WHATWG URL spec allows it in hostnames, so we do, too.
// TODO(so
on): The URL spec actually allows a lot more than just '_', and requires nameprepping to
// TODO(so
meday): The URL spec actually allows a lot more than just '_', and requires nameprepping
// Punycode. We'll have to decide how we want to deal with all that.
//
to
Punycode. We'll have to decide how we want to deal with all that.
void
toLower
(
String
&
text
)
{
void
toLower
(
String
&
text
)
{
for
(
char
&
c
:
text
)
{
for
(
char
&
c
:
text
)
{
...
...
c++/src/kj/debug.c++
View file @
b40445e7
...
@@ -137,7 +137,7 @@ Exception::Type typeOfErrno(int error) {
...
@@ -137,7 +137,7 @@ Exception::Type typeOfErrno(int error) {
Exception
::
Type
typeOfWin32Error
(
DWORD
error
)
{
Exception
::
Type
typeOfWin32Error
(
DWORD
error
)
{
switch
(
error
)
{
switch
(
error
)
{
// TODO(so
on
): This needs more work.
// TODO(so
meday
): This needs more work.
case
WSAETIMEDOUT
:
case
WSAETIMEDOUT
:
return
Exception
::
Type
::
OVERLOADED
;
return
Exception
::
Type
::
OVERLOADED
;
...
@@ -360,7 +360,7 @@ void Debug::Fault::init(
...
@@ -360,7 +360,7 @@ void Debug::Fault::init(
const
char
*
file
,
int
line
,
Win32Result
osErrorNumber
,
const
char
*
file
,
int
line
,
Win32Result
osErrorNumber
,
const
char
*
condition
,
const
char
*
macroArgs
,
ArrayPtr
<
String
>
argValues
)
{
const
char
*
condition
,
const
char
*
macroArgs
,
ArrayPtr
<
String
>
argValues
)
{
LPVOID
ptr
;
LPVOID
ptr
;
// TODO(so
on
): Why doesn't this work for winsock errors?
// TODO(so
meday
): Why doesn't this work for winsock errors?
DWORD
result
=
FormatMessageW
(
FORMAT_MESSAGE_ALLOCATE_BUFFER
|
DWORD
result
=
FormatMessageW
(
FORMAT_MESSAGE_ALLOCATE_BUFFER
|
FORMAT_MESSAGE_FROM_SYSTEM
|
FORMAT_MESSAGE_FROM_SYSTEM
|
FORMAT_MESSAGE_IGNORE_INSERTS
,
FORMAT_MESSAGE_IGNORE_INSERTS
,
...
...
c++/src/kj/filesystem-disk-test.c++
View file @
b40445e7
...
@@ -729,7 +729,7 @@ KJ_TEST("DiskDirectory createTemporary") {
...
@@ -729,7 +729,7 @@ KJ_TEST("DiskDirectory createTemporary") {
KJ_EXPECT
(
dir
->
listNames
()
==
nullptr
);
KJ_EXPECT
(
dir
->
listNames
()
==
nullptr
);
}
}
#if !__CYGWIN__ // TODO(so
on
): Figure out why this doesn't work on Cygwin.
#if !__CYGWIN__ // TODO(so
meday
): Figure out why this doesn't work on Cygwin.
KJ_TEST
(
"DiskDirectory replaceSubdir()"
)
{
KJ_TEST
(
"DiskDirectory replaceSubdir()"
)
{
TempDir
tempDir
;
TempDir
tempDir
;
auto
dir
=
tempDir
.
get
();
auto
dir
=
tempDir
.
get
();
...
...
c++/src/kj/filesystem-disk-win32.c++
View file @
b40445e7
...
@@ -1171,7 +1171,7 @@ public:
...
@@ -1171,7 +1171,7 @@ public:
candidatePath
,
candidatePath
,
GENERIC_READ
|
GENERIC_WRITE
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
0
,
NULL
,
// TODO(so
on
): makeSecAttr(WriteMode::PRIVATE), when it's implemented
NULL
,
// TODO(so
meday
): makeSecAttr(WriteMode::PRIVATE), when it's implemented
CREATE_NEW
,
CREATE_NEW
,
FILE_ATTRIBUTE_TEMPORARY
|
FILE_FLAG_DELETE_ON_CLOSE
,
FILE_ATTRIBUTE_TEMPORARY
|
FILE_FLAG_DELETE_ON_CLOSE
,
NULL
);
NULL
);
...
...
c++/src/kj/mutex-test.c++
View file @
b40445e7
...
@@ -119,7 +119,7 @@ TEST(Mutex, MutexGuarded) {
...
@@ -119,7 +119,7 @@ TEST(Mutex, MutexGuarded) {
EXPECT_EQ
(
321u
,
value
.
getWithoutLock
());
EXPECT_EQ
(
321u
,
value
.
getWithoutLock
());
}
}
#if KJ_USE_FUTEX // TODO(so
on
): Implement on pthread & win32
#if KJ_USE_FUTEX // TODO(so
meday
): Implement on pthread & win32
TEST
(
Mutex
,
When
)
{
TEST
(
Mutex
,
When
)
{
MutexGuarded
<
uint
>
value
(
123
);
MutexGuarded
<
uint
>
value
(
123
);
...
...
c++/src/kj/mutex.h
View file @
b40445e7
...
@@ -66,7 +66,7 @@ public:
...
@@ -66,7 +66,7 @@ public:
// non-trivial, assert that the mutex is locked (which should be good enough to catch problems
// non-trivial, assert that the mutex is locked (which should be good enough to catch problems
// in unit tests). In non-debug builds, do nothing.
// in unit tests). In non-debug builds, do nothing.
#if KJ_USE_FUTEX // TODO(so
on
): Implement on pthread & win32
#if KJ_USE_FUTEX // TODO(so
meday
): Implement on pthread & win32
class
Predicate
{
class
Predicate
{
public
:
public
:
virtual
bool
check
()
=
0
;
virtual
bool
check
()
=
0
;
...
@@ -263,7 +263,7 @@ public:
...
@@ -263,7 +263,7 @@ public:
inline
T
&
getAlreadyLockedExclusive
()
const
;
inline
T
&
getAlreadyLockedExclusive
()
const
;
// Like `getWithoutLock()`, but asserts that the lock is already held by the calling thread.
// Like `getWithoutLock()`, but asserts that the lock is already held by the calling thread.
#if KJ_USE_FUTEX // TODO(so
on
): Implement on pthread & win32
#if KJ_USE_FUTEX // TODO(so
meday
): Implement on pthread & win32
template
<
typename
Cond
,
typename
Func
>
template
<
typename
Cond
,
typename
Func
>
auto
when
(
Cond
&&
condition
,
Func
&&
callback
)
const
->
decltype
(
callback
(
instance
<
T
&>
()))
{
auto
when
(
Cond
&&
condition
,
Func
&&
callback
)
const
->
decltype
(
callback
(
instance
<
T
&>
()))
{
// Waits until condition(state) returns true, then calls callback(state) under lock.
// Waits until condition(state) returns true, then calls callback(state) under lock.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment