From: Tay Ray Chuan <hidden> Date: 2016-06-15 22:46:07
In 753bc91 ("Remove the requirement opaquelocktoken uri scheme"), the
lock token is guaranteed to be prefixed with the string
'opaquelocktoken:', which propagated down to file path creation
operations in the remote repository, namely, in start_put (and
consequently start_move).
These file operations may not be successful, due to the colon ':'
character in the file path (specifically, in Windows).
This patch ensures that the lock token sans 'opaquelocktoken:' is used
instead in start_put.
Note on tests: In the second grep, we check that Apache returns status
20* (ie. the request was successful), but in the first we do not do
so, since file creation by PUSH/MOVE is not guaranteed to succeed (see
above).
Signed-off-by: Tay Ray Chuan <redacted>
---
http-push.c | 2 +-
t/t5540-http-push.sh | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletions(-)
Umm. This "16" is a little bit too hardcoded for my liking. I mean, it
is not even obvious from _this_ hunk why "16" should be correct.
Besides, I have to wonder where request->lock->token is set, and if that
would not be the better place to fix the issue?
Ciao,
Dscho
From: Tay Ray Chuan <hidden> Date: 2016-06-15 22:46:07
Hi,
On Sun, Feb 8, 2009 at 1:03 AM, Johannes Schindelin
[off-list ref] wrote:
Umm. This "16" is a little bit too hardcoded for my liking. I mean, it
is not even obvious from _this_ hunk why "16" should be correct.
Any solutions for this? Would a comment like "skip 'opaquelocktoken:'
prefix of length 16" be sufficient? Or maybe in the commit message?
I considered a set of strbuf functions, like for the remote object url
(get_remote_object_url and append_remote_object_url), but I thought it
was a little overkill, since this is one of the only instances that I
can think of where including 'opaquelocktoken:' is unwanted.
Besides, I have to wonder where request->lock->token is set, and if that
would not be the better place to fix the issue?
Are you suggesting perhaps that we revert commit 753bc91? Or perhaps
create another way to access lock tokens, say, get_lock_token(int
prepend_scheme)?
--
Cheers,
Ray Chuan
From: Johannes Schindelin <hidden> Date: 2016-06-15 22:46:07
Hi,
On Sun, 8 Feb 2009, Tay Ray Chuan wrote:
On Sun, Feb 8, 2009 at 1:03 AM, Johannes Schindelin
[off-list ref] wrote:
quoted
Besides, I have to wonder where request->lock->token is set, and if
that would not be the better place to fix the issue?
Are you suggesting perhaps that we revert commit 753bc91? Or perhaps
create another way to access lock tokens, say, get_lock_token(int
prepend_scheme)?
I do not suggest anything like that.
But I _refuse_ to go and investigate a thing that you should know already,
and that you should be able to defend, indeed, something you should have
defended in the commit message:
Why does request->lock->token have the prefix at all?
Ciao,
Dscho
From: Tay Ray Chuan <hidden> Date: 2016-06-15 22:46:07
Hi,
On Sun, Feb 8, 2009 at 2:57 AM, Johannes Schindelin
[off-list ref] wrote:
Huh? What does that mean? Does lock->token have that prefix (including
the colon) or not?
Yes, it does have the prefix with colon, but it is not true that it is
always "opaquelocktoken:" -- it could be some other URI scheme.
I submitting a new patch that accounts for this (other URI schemes).
--
Cheers,
Ray Chuan